{% set pypi_name = 'python-zaqarclient' %}
{% set upstream_version = upstream_version('2.0.1') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Client Library for OpenStack Zaqar Queueing API
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('ddt') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('jsonschema') }}
BuildRequires:  {{ py3('keystoneauth1') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('nose') }}
BuildRequires:  {{ py3('nose-exclude') }}
BuildRequires:  {{ py3('os-client-config') }}
BuildRequires:  {{ py3('osc-lib') }}
BuildRequires:  {{ py3('oslo.i18n') }}
BuildRequires:  {{ py3('oslo.log') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('python-subunit') }}
BuildRequires:  {{ py3('requests') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('testrepository') }}
BuildRequires:  {{ py3('testscenarios') }}
BuildRequires:  {{ py3('testtools') }}
BuildArch:      noarch

%description
Python client to Zaqar Queueing API.

%package -n python3-zaqarclient
Summary:        Client Library for OpenStack Zaqar Queueing API
Requires:       {{ py3('jsonschema') }}
Requires:       {{ py3('keystoneauth1') }}
Requires:       {{ py3('osc-lib') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.log') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('requests') }}
Requires:       {{ py3('six') }}
Requires:       {{ py3('stevedore') }}

%description -n python3-zaqarclient
Python client to Zaqar Queueing API.

This package contains the Python 3.x module.

%package -n {{ py2name() }}-doc
Summary:        Documentation for OpenStack Zaqar Queueing API
Group:          Documentation/HTML
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('openstackdocstheme') }}

%description -n {{ py2name() }}-doc
Documentation for the client library for interacting with Openstack
Zaqar Queueing API.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
%py3_build

# Build HTML docs and man page
PBR_VERSION=%{version} %sphinx_build -b html doc/source doc/build/html
rm -r doc/build/html/.{doctrees,buildinfo}

%install
%py3_install

%check
%if 0%{?suse_version}
PYTHONPATH=. nosetests
%else
PYTHONPATH=. nosetests-3
%endif

%files -n python3-zaqarclient
%doc README.rst ChangeLog examples
%license LICENSE
%{python3_sitelib}/zaqarclient
%{python3_sitelib}/python_zaqarclient-*-py?.?.egg-info

%files -n {{ py2name() }}-doc
%doc doc/build/html
%license LICENSE

%changelog
